home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7026 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: asciizero@aol.com (ASCII zero)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to Display a File Backwards?
  5. Date: 17 Feb 1996 11:56:51 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4g51cj$t6o@newsbf02.news.aol.com>
  9. References: <4g3eplINNo0k@keats.ugrad.cs.ubc.ca>
  10. Reply-To: asciizero@aol.com (ASCII zero)
  11. NNTP-Posting-Host: newsbf02.mail.aol.com
  12.  
  13. OK, I owe you more explanation of my dilemma so here it is.
  14.  
  15. I have a message log file (text) that gets updated on a regular basis
  16. depending on what errors the system detects during the course of its
  17. operation. Now, I want a tool that would display the contents of the
  18. message log beginning from the last line or the latest entry. This tool
  19. will run every 30 minutes. The message log will be updated in-between tool
  20. runs (i.e. when the file is not being displayed).
  21.  
  22. If the message log contains the following lines:
  23. 96-02-16/11:15:23  Error number 1
  24. 96-02-16/11:31:01  Message number 110
  25. 96-02-16/14:00:59  Error number 51
  26. 96-02-16/23:14:13  Error number 6
  27.  
  28. the screen display should show:
  29. 96-02-16/23:14:13  Error number 6
  30. 96-02-16/14:00:59  Error number 51
  31. 96-02-16/11:31:01  Message number 110
  32. 96-02-16/11:15:23  Error number 1
  33.  
  34. Notes:
  35. (1)  I'm not sure if I have enough memory to hold the file because the
  36. file's size is likely to vary as time moves on.
  37. (2) I can't use functions that are not included in the standard ANSI C
  38. library
  39. (3) I can go to the end of the file and I *think* I can even display the
  40. last line in readable form (not backwards), but I'm not sure about taking
  41. it from there on because I'm always assuming that no two lines are equal
  42. in length.
  43.  
  44. I really hope I'm making some sense here.  :)  Please post or mail any
  45. suggestions you may have. Thanks!
  46.  
  47. James
  48. ASCIIzero@aol.com(J. J. Cariaso)
  49.